﻿namespace EasyGo.Common
{
    using System;
    using System.Transactions;

    public static class Transaction
    {
        public static void Execute(Action block)
        {
            using (var transaction = new TransactionScope(TransactionScopeOption.RequiresNew))
            {
                block();

                transaction.Complete();
            }
        }
    }
}
